interface AppResult<T> {
  code?: string;
  data?: T;
  message?: string;
  additional?: any;
}

interface Pageable<T> {
  pageNo?: number;
  pageSize?: number;
  total?: number;
  data?: T[];
}

declare type IEntity = NonNullable<unknown>

declare type IdType = string | number;

interface AbstractBaseEntity extends IEntity {
  tenantId?: string;
  createTime?: number;
  updateTime?: number;
  createUser?: string;
  updateUser?: string;
  version?: number;
}

interface IdEntity<T> extends IEntity {
  id?: T;
}

interface AbstractIdEntity extends AbstractBaseEntity, IdEntity<string> {
}

interface ITreeEntity<Id extends IdType, T> extends IdEntity<Id> {
  parentId?: Id;
  children?: T[];
}

export {
  AppResult, Pageable, IdType, IEntity, AbstractBaseEntity, IdEntity, AbstractIdEntity, ITreeEntity,
};